﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Domain;

namespace Clannan.Models.JsonModel
{
    public class MemoJsonModel
    {
        private int id;

        public int ID
        {
            get { return id; }
            set { id = value; }
        }

        private string content;

        public string Content
        {
            get { return content; }
            set { content = value; }
        }
        private DateTime createtime;

        public DateTime CreateTime
        {
            get { return createtime; }
            set { createtime = value; }
        }
        private DateTime warntime;

        public DateTime WarnTime
        {
            get { return warntime; }
            set { warntime = value; }
        }

        /// <summary>
        /// 将对象复制给JsonModel类，防止序列化时会出现重复引用
        /// </summary>
        public MemoJsonModel Copy(MemoJsonModel memoJsonModel, Memo memo)
        {
            memoJsonModel = new MemoJsonModel();
            memoJsonModel.ID = memo.ID;
            memoJsonModel.Content = memo.Content;
            memoJsonModel.CreateTime = memo.CreateTime;
            memoJsonModel.WarnTime = memo.WarnTime;
            return memoJsonModel;
        }
    }
}